package com.lz.football.module.guide.setting.view
{
	import com.greensock.TweenLite;
	import com.greensock.easing.Bounce;
	import com.lz.football.module.base.IComponent;
	
	import flash.display.MovieClip;
	import flash.display.Shape;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.MouseEvent;

	/**
	 *引导选择面板基类 
	 * @author lake
	 * 
	 */	
	public class GuideBaseSelectPanel extends Sprite implements IComponent
	{
		/**
		 *skin 
		 */		
		public var _symbolSkin :MovieClip;
		/**
		 *容器 
		 */		
		public var container :MovieClip ;
		/**
		 * 下一步
		 */		
		public var nextBtn 		:SimpleButton;
		/**
		 *文字描述 
		 */		
		protected var descMc :MovieClip;
		/**
		 * 描述遮罩
		 */		
		protected var descMaskSp :Shape;
		/**
		 *文字描述显示时间 
		 */		
		protected var showDescTime :Number = 2;
		/**
		 *显示容器时间 
		 */		
		protected var showContainerTime :Number = 0;
		/**
		 * 延迟显示容器时间
		 */		
		protected var showContainerDelay	:Number = 2;
		/**
		 *延迟显示描述时间 
		 */		
		protected var showDescDelay		:Number = 1;
		/**
		 * 容器x
		 */		
		protected var containerX :Number = 0;
		/**
		 *容器y 
		 */		
		protected var containerY :Number = 0;
		
		public function GuideBaseSelectPanel()
		{
			super();
		}
		/**
		 *数据 
		 */		
		protected var _data			:*;
		
		/**
		 * 设置数据
		 * @param value
		 * 
		 */		
		public function set data(value :*):void
		{
			_data = value;
		}
		/**
		 * 获取数据
		 * @return 
		 * 
		 */		
		public function get data():*
		{
			return _data;
		}
		/**
		 *设置可见 
		 * @param value
		 * 
		 */		
		override public function set visible(value:Boolean):void
		{
			super.visible = value;
			_symbolSkin.visible = value;
		}
		/**
		 *获取可见 
		 * @return 
		 * 
		 */		
		override public function get visible():Boolean
		{
			return _symbolSkin.visible;
		}
		/**
		 * 初始化
		 * @param view
		 * 
		 */		
		public function initUI(view:Object=null):void
		{
			_symbolSkin = view as MovieClip;
			nextBtn = _symbolSkin.nextBtn;
			addEvtListener();
		}
		/**
		 * 
		 * 添加事件
		 */		
		public function addEvtListener():void
		{
			nextBtn.addEventListener(MouseEvent.CLICK,nextHandler);
		}
		/**
		 *刷新 
		 * @param e
		 * 
		 */		
		protected function refreshHandler(e :MouseEvent):void
		{
			nextBtn.mouseEnabled = false;
		}
		/**
		 *下一步 
		 * @param e
		 * 
		 */		
		protected function nextHandler(e :MouseEvent):void
		{
			
		}
		/**
		 *显示内容
		 */		
		protected function showContainer():void
		{
			TweenLite.to(container,showContainerTime,{x:containerX,onComplete:showContainerComplete,ease:Bounce.easeInOut});
		}
		/**
		 *显示内容完成 
		 */		
		protected function showContainerComplete():void
		{
		}
		/**
		 * 
		 * 删除事件
		 */		
		public function removeEvtListener():void
		{
			nextBtn.removeEventListener(MouseEvent.CLICK,nextHandler);
		}
		/**
		 *浅入 
		 * 
		 */		
		public function fadeIn():void
		{
			_symbolSkin.alpha = 0;
			TweenLite.to(_symbolSkin,.5,{alpha:1});
		}
		/**
		 * 
		 * 销毁
		 */		
		public function destroyView():void
		{
			removeEvtListener();
			_data = null;
		}
	}
}